package com.bkitclub.mobiledevcamp.horseword.util;

import android.app.Activity;
import android.view.Display;

public class Utils {
	private static int screenHeight,screenWidth;
	public static void loadScreenSize(Activity context){
		Display display = context.getWindowManager().getDefaultDisplay(); 
		int width = display.getWidth();
		int height = display.getHeight();
		screenHeight = width > height ? height : width;
		screenWidth = width > height ? width : height;
		if(screenWidth >900){
			resourceType = RESOURCE_TYPE_HUGE;
		} else if(screenWidth > 600){
			resourceType = RESOURCE_TYPE_LARGE;
		} else if(screenWidth > 450){
			resourceType = RESOURCE_TYPE_MEDIUM;
			scale = screenWidth / 800.0;
		} else {
			resourceType = RESOURCE_TYPE_SMALL;
			scale = screenWidth / 800.0;
		}
	}
	public static int getScreenWidth(){
		return screenWidth;
	}
	public static int getScreenHeight(){
		return screenHeight;
	}
	public static int getResourceType(){
		return resourceType;
	}
	private static double scale = 1.0;
	public static double getScale(){
		return scale;
	}
	private static int resourceType;
	public static final int RESOURCE_TYPE_HUGE = 0;
	public static final int RESOURCE_TYPE_LARGE = 1;
	public static final int RESOURCE_TYPE_MEDIUM = 2;
	public static final int RESOURCE_TYPE_SMALL = 3;
}
